12. Waypoint Updater Node (Full)

Waypoint Updater Node Revisited

Once traffic light detection is working properly, you can incorporate the traffic light data into your waypoint updater node. To do this, you will need to add a subscriber for the /traffic_waypoint topic and implement the traffic_cb callback for this subscriber.

There are several helpful methods that you can use:

  • get_waypoint_velocity(self, waypoint) : gets the linear velocity (x-direction) for a single waypoint.
  • set_waypoint_velocity(self, waypoints, waypoint, velocity) : sets the linear velocity (x-direction) for a single waypoint in a list of waypoints. Here, waypoints is a list of waypoints, waypoint is a waypoint index in the list, and velocity is the desired velocity.
  • distance(self, waypoints, wp1, wp2) : Computes the distance between two waypoints in a list along the piecewise linear arc connecting all waypoints between the two. Here, waypoints is a list of waypoints, and wp1 and wp2 are the indices of two waypoints in the list. This method may be helpful in determining the velocities for a sequence of waypoints leading up to a red light (the velocities should gradually decrease to zero starting some distance from the light).

To accomplish this part of the project successfully, you will need to adjust the target velocities for the waypoints leading up to red traffic lights or other obstacles in order to bring the vehicle to a smooth and full stop. You should aim to have a smooth decrease in velocity leading up to the stopping point.

It will be up to you determine what the deceleration should be for the vehicle, and how this deceleration corresponds to waypoint target velocities. As in the Path Planning project, acceleration should not exceed 10 m/s^2 and jerk should not exceed 10 m/s^3.

Important:

Be sure to limit the top speed of the vehicle to the km/h velocity set by the velocity rosparam in waypoint_loader . Reviewers will test on the simulator with an adjusted top speed prior to testing on Carla.